package cn.brilliantfuture.commentry.entity;

// Generated 2012-1-9 14:57:15 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * DeliveryPlan generated by hbm2java
 */
@Entity
@Table(name = "delivery_plan", catalog = "cabinet")
public class DeliveryPlan implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer deliveryPlanId;
	private Lockers lockers;
	private StorageGrid storageGrid;
	private OrderInformation orderInformation;
	private ProductBatch productBatch;
	private StorageGridPurchaserNews storageGridPurchaserNews;
	private int planType = 1;
	private Date beginTime;
	private Date endTime;
	private boolean publish;
	private Date insertTime;
	private Date unreserveTime;

	public DeliveryPlan() {
	}

	public DeliveryPlan(Lockers lockers, StorageGrid storageGrid,OrderInformation orderInformation, ProductBatch productBatch, Date beginTime,Date endTime, boolean publish, Date insertTime,
			Integer insertUser, boolean deleted) {
		this.lockers = lockers;
		this.storageGrid = storageGrid;
		this.orderInformation = orderInformation;
		this.productBatch = productBatch;
		this.beginTime = beginTime;
		this.endTime = endTime;
		this.publish = publish;
		this.insertTime = insertTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "delivery_plan_id", unique = true, nullable = false)
	public Integer getDeliveryPlanId() {
		return this.deliveryPlanId;
	}

	public void setDeliveryPlanId(Integer deliveryPlanId) {
		this.deliveryPlanId = deliveryPlanId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "begin_time", length = 19)
	public Date getBeginTime() {
		return this.beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time", length = 19)
	public Date getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "lockers_id")
	public Lockers getLockers() {
		return lockers;
	}
	public void setLockers(Lockers lockers) {
		this.lockers = lockers;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_id")
	public StorageGrid getStorageGrid() {
		return storageGrid;
	}
	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_information_id")
	public OrderInformation getOrderInformation() {
		return orderInformation;
	}
	public void setOrderInformation(OrderInformation orderInformation) {
		this.orderInformation = orderInformation;
	}

	@OneToOne
	@JoinColumn(name = "product_batch_id", unique = true)
	public ProductBatch getProductBatch() {
		return productBatch;
	}
	public void setProductBatch(ProductBatch productBatch) {
		this.productBatch = productBatch;
	}

	@OneToOne(optional = true, mappedBy = "deliveryPlan")
	public StorageGridPurchaserNews getStorageGridPurchaserNews() {
		return storageGridPurchaserNews;
	}

	public void setStorageGridPurchaserNews(
			StorageGridPurchaserNews storageGridPurchaserNews) {
		this.storageGridPurchaserNews = storageGridPurchaserNews;
	}

	@Column(name = "plan_type", nullable = false)
	public int getPlanType() {
		return planType;
	}

	public void setPlanType(int planType) {
		this.planType = planType;
	}

	@Column(name = "publish", nullable = false)
	public boolean isPublish() {
		return publish;
	}

	public void setPublish(boolean publish) {
		this.publish = publish;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "unreserve_time", length = 19)
	public Date getUnreserveTime() {
		return unreserveTime;
	}

	public void setUnreserveTime(Date unreserveTime) {
		this.unreserveTime = unreserveTime;
	}

}
